package com.linkhub.oms.data.sync.job;

import com.linkhub.oms.data.sync.service.YunTuBizService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author Jaycle
 * @version 1.0.0
 * @description YunTuGetOrderStatusJod
 * @date 2024/05/08日 20:08
 */
@Slf4j
@Component
public class YunTuJod {
    @Resource
    private YunTuBizService yunTuBizService;

    // 查询已发货订单对应的运单状态，如果已签收则更新订单状态
    @Scheduled(cron = "0 0 1 * * ?")
    public void getOrderStatusJod() {
        log.info("getOrderStatusJod start...");
        yunTuBizService.getOrderStatusJod();
        log.info("getOrderStatusJod end...");
    }

    // 查询已发货订单对应的跟踪号
    @Scheduled(cron = "0 0 1 * * ?")
    public void getTrackingNumberJod() {
        log.info("getTrackingNumberJod start...");
        yunTuBizService.getTrackingNumberJod();
        log.info("getTrackingNumberJod end...");
    }
}
